#include "GameObject2D.h"
#include "GameCore\Screen.h"
void GameObject2D::Init()
{

}
void GameObject2D::Update(float timeDelta)
{
	if (destroyed && (!useAnim || animInst->IsStopped()))
	{
		removed = true;
	}
	position = position + move*timeDelta;
	if (useAnim)
	{
		animInst->Update(timeDelta);
	}
	if (position.y > Screen::GetInstance()->GetHeight() / 1.9f)
	{
		removed = true;
	}
}
void GameObject2D::Render()
{
	if (useAnim)
	{
		sprite->DrawAnimLogical(animInst, position.x, position.y);
	}
	else
	{
		sprite->DrawFrameLogical(frame, position.x, position.y);
	}
}
void GameObject2D::Release()
{

}
